from selenium import webdriver
from selenium.webdriver.common.by import By
browser = webdriver.Chrome()
browser.implicitly_wait(10)
try:
    browser.get('https://www.baidu.com')
    search_box = browser.find_element(By.CSS_SELECTOR, 'input#kw')
    print('定位到搜索框')
except:
    print('等待超时')
finally:
    browser.quit()
